<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/tern/tern-tags.tld" prefix="tern"%>
<tern:page pageForm="teacher.UploadXMLFilePage">
	<html>
<head>
<title>附件上传</title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<link rel="stylesheet" type="text/css"
	href="${applicationScope.root}skins/default/main.css">
<link type="text/css"
	href="${applicationScope.root}js/themes/ui-lightness/jquery.ui.all.css"
	rel="stylesheet" />
<script type="text/javascript"
	src="${applicationScope.root}js/jquery.min.js"></script>
<script type="text/javascript"
	src="${applicationScope.root}js/ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="${applicationScope.root}js/util.js"></script>
<link href="${applicationScope.root}jquery/upload/uploadify.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="${applicationScope.root}jquery/jquery.min.js"></script>
<script type="text/javascript"
	src="${applicationScope.root}jquery/upload/swfobject.js"></script>
<script type="text/javascript"
	src="${applicationScope.root}jquery/upload/uploadify.min.js"></script>
<script language="javascript">
	$(function() {
		var rootPath = '${applicationScope.root}jquery/upload/';
		$("#uploadfile").uploadify({
			'uploader' : rootPath + 'uploadify.swf',
			'script' : $('form:first').attr('action'),
			'cancelImg' : rootPath + '/cancel.png',
			'auto' : true,
			'multi' : false,
			'fileDataName' : 'cont_file',
			'onComplete' : function() {
				on_event('onRefeash', '');
			}
		});
	});
	
	function check(){
		var f = document.myform; 
		var path = f.uploadfile.value;
		if(path==""){
			alert("没有选择文件!"); 
			return false; 
		}
		return true;
	}
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
	background="../images/bg.gif" onLoad="">
	<div align="center">
	<br>
	<br>
	<br>
		<h3>请选择相应的文件上传，注意文件格式...</h3>
	</div>
	<br>
	<br>
	<br>
	<div align="center">
		<tern:form name="myform" id="myform" method="post"
			enctype="multipart/form-data">
			
			<div>
			<input type="file" name="uploadfile" id="uploadfile" />
			
			<input id="bSave" type="button" class="inputButton" value=" 保存  "
				onclick="if(check()){on_event('onSave','')}" />
		</div>
<input name="b_refreah" type="button" value="刷新" style="display: none"
			onClick="on_event('onRefresh','')" />
		</tern:form>
	</div>
</body>
	</html>
</tern:page>